home *** CD-ROM | disk | FTP | other *** search
Text File | 1990-03-30 | 2.2 KB | 58 lines | [TEXT/GEOL] |
- Item 9970676 30-March-90 15:22PST
-
- From: POWERUP.ENG Power Up Software,PRT
-
- To: MACAPP.TECH$ MacApp Technical
- MADA2 MacApp Dev Assoc, Curtis Faith,IVC
-
- Sub: RE>RE(2) FindObject() and
-
- Attn: MacApp.Tech$
- Attn: MacApp Dev Assoc, Curtis Faith
- SentBy: James Plamondon
- Date 3/30/90
- Subject RE>RE(2) FindObject() and F
- From James Plamondon
- To MacApp Dev Assoc, Curtis Faith
- CC MacApp.Tech$
-
- Reply to: RE>RE(2) FindObject() and Find
- Dear Curtis,
-
- Thank you for your cogent response to my recent link regarding TSortedList. I
- have a few comments in response.
-
- You mention that "FindValue also limits a particular object to having only one
- search criterion unless one bypasses it and uses Search directly."
-
- This is entirely correct. FindValue() useful only in such cases. But I think
- that this is an exceptionally common case, and one which therefore should be
- dealt with in a TSortedList method.
-
- Then you ask why I could not "simply subclass TSortedList and provide a new
- method TMySortedList.FindSomeObjectThatIWant that uses the particular TestItem
- mentioned above. You would use FindSomeObjectThatIWant instead of
- Search(TestItem). You would have only one instance of TestItem to worry about
- and your code would be more readable since you could name the method in a way
- that lends meaning (FindOldestObject, FindBiggestObject, etc.)."
-
- That is exactly what I have done; the routine
- TMySortedList.FindSomeObjectThatIWant() is called TMySortedList.FindValue().
-
- The purpose is not to add greater generality to TSortedList; it is quite
- general already. However, the class does not make it easy to do a very common
- special case — that of finding the entry with a given key value. To do this,
- one must use the general Search() method. If the common special case were
- addressed by its own, very focused method — FindValue() — then the class would
- be easier to use in this common case, while still having the power and
- flexibility of the more general Search() routine where it was needed — and I
- think that you (and everyone else) would find the class to be both more useful
- and less confusing.
-
- Hoping this helps, I remain
-
- Yours,
-
- James Plamondon
-
-